package libs.yzx.zaza.acts3;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import libs.yzx.zaza.R;

/**
 * Created by Administrator on 2016/10/25
 */

public class ViewGoneActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view_gone);

    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        //findViewById(R.id.layout).setVisibility(View.GONE);
    }


    ////  当父布局Gone后, 子View会调用onVisibilityChanged方法参数是GONE,
    ////  如果activity 进入后台后,子View还会调用onVisibilityChanged方法参数是INVISIBLE
    ////  如果activity从新进入前台,子View还会调用onVisibilityChanged方法,参数是VISIBLE,但是子View的目前状态是GONE的,这里是不准确的


    ////  View.post方法会在View准备好之后执行,
    ////  如果父View调用post方法,会在子View准备好后执行,不用担心子View没有准备完毕
    ////  如果父View和子View同时post,谁先写的post方法谁先执行

}
